﻿using System.Windows.Controls;

namespace Sidvall.UI.Wpf
{
	public class WebBrowserManager
	{
		#region Public Members

		public void Hide()
		{
			this.Count += 1;
			this.WebBrowser.Height = 0;
		}
		public void Show()
		{
			this.Count -= 1;
			if (this.Count < 0)
				this.Count = 0;
			if (this.Count == 0)
				this.WebBrowser.Height = double.NaN;
		}

		#endregion
		#region Private Members

		private WebBrowser WebBrowser { get; set; }
		private int Count { get; set; }

		#endregion
		#region Constructors

		public WebBrowserManager(WebBrowser webBrowser)
		{
			this.WebBrowser = webBrowser;
			this.Count = 0;
		}

		#endregion
	}
}
